using System;
using System.Net.Mail;
using SpiderMaster.AspNet.TradingSystem.BusinessLogicLayer;

namespace SpiderMaster.AspNet.TradingSystem
{
    public partial class EmailManagerOld
    {
        public partial class Helper
        {
            public partial class Send
            {
                public static bool ContactUsEmail(String UserName, String FirstName, Int32 ToMemberId, String Subject, String Details, String SendToAdministratorType)
                {
                    bool Success = true;
                    try
                    {
                        foreach (string st in RoleManagement.GetRecipients(true, false, PredefinedRole.GeneralAdministrator))
                        {
                            using (MailMessage EmailMessage = new MailMessage(SiteSettings.Current.MailSenderAddressFormatted, st))
                            {
                                Reader.LoadContactUs(EmailMessage, UserName, FirstName, ToMemberId, Subject, Details, st, SendToAdministratorType);
                                Success = EmailManager.SendCompletedEmail(ToMemberId, EmailMessage);
                            }
                        }
                    }
                    catch { Success = false; }

                    return Success;
                }
            }
        }
    }
}